<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/public/taglib.jsp"%>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>友情链接</title>
<%@ include file="/WEB-INF/page/public/meta.jsp"%>
</head>
<body>
  
 <div style="margin: 20px;">     
    <blockquote class="layui-elem-quote list_search">
         <%--<shiro:hasPermission name="xinyongka:xinyongka:save">--%>
         <div class="layui-inline">
             <a class="layui-btn layui-btn-normal cmslinkAdd_btn" id="cmslinkAdd_btn"><i
                     class="layui-icon">&#xe608;</i> 添加</a>
         </div>
         <%--</shiro:hasPermission>--%>
        <%--<shiro:hasPermission name="sys:admin:delete">--%>
             <div class="layui-inline">
                 <a class="layui-btn layui-btn-danger batchDel"><i
                         class="layui-icon">&#xe640;</i>批量删除</a>
             </div>
         <%--</shiro:hasPermission>--%>
         <%--<div class="layui-inline">--%>
         <%--<div class="layui-form-mid layui-word-aux"><a class="layui-btn layui-btn-danger" id="testdata" ><i--%>
         <%-->&#xe640;</i>测试数据</a>--%>
         <%--</div>--%>
         <%--</div>--%>
     </blockquote>
	<table class="layui-table" lay-data="{ url:'${ctx}/cmslink/list', method:'post',  page:true, id:'listTable'}" lay-filter="list">
	  <thead>
	    <tr>
	      <th lay-data="{type:'checkbox', fixed: 'left'}"></th>
	      							   <th lay-data="{field:'id',width:300}">编号</th>
		    			 			   <th lay-data="{field:'categoryId',width:300}">栏目编号</th>
		    			 			   <th lay-data="{field:'title',width:300}">链接名称</th>
		    			 			   <th lay-data="{field:'color',width:300}">标题颜色</th>
		    			 			   <th lay-data="{field:'image',width:300}">链接图片</th>
		    			 			   <th lay-data="{field:'href',width:300}">链接地址</th>
		    			 			   <th lay-data="{field:'weight',width:300}">权重，越大越靠前</th>
		    			 			   <th lay-data="{field:'weightDate',width:300}">权重期限</th>
		    			 			   <th lay-data="{field:'createBy',width:300}">创建者</th>
		    			 			   <th lay-data="{field:'updateBy',width:300}">更新者</th>
		    			 			   <th lay-data="{field:'remarks',width:300}">备注信息</th>
		    			 			   <th lay-data="{field:'delFlag',width:300}">删除标记</th>
		    			 			   <th lay-data="{field:'createTime',width:300}">创建时间</th>
		    			 			   <th lay-data="{field:'updateTime',width:300}">更新时间</th>
		    			 			   <th lay-data="{field:'deleteTime',width:300}">删除时间</th>
		    	      <th lay-data="{fixed: 'right', align:'center', toolbar: '#bar',width:150}">操作</th>
	    </tr>
	  </thead>
	</table>
	<script type="text/html" id="bar">
 	  <%--<a class="layui-btn layui-btn-xs" lay-event="show" >查看</a>--%>
 	  <a class="layui-btn layui-btn-xs" lay-event="edit" >修改</a>
 	  <a class="layui-btn layui-btn-xs" lay-event="del" >删除</a>
	</script> 
</div>	
	 
 <script src="${ctx}/page/cmslink/cmslink.js?<%=System.currentTimeMillis()%>"></script>

 <script type="text/html" id="creatTpl">
        <div>{{ formatTime(d.createTime,"yyyy-MM-dd")}}</div>
    </script>
    <script type="text/html" id="updateTpl">
        <div>{{ formatTime(d.updateTime,"yyyy-MM-dd")}}</div>
    </script>
    <script type="text/html" id="deleteTpl">
        <div>{{ formatTime(d.deleteTime,"yyyy-MM-dd")}}</div>
    </script>
   <script>

    //格式化时间
    function formatTime(datetime, fmt) {
        if (datetime == null || datetime == 0) {
            return "";
        }
        if (parseInt(datetime) == datetime) {
            if (datetime.length == 10) {
                datetime = parseInt(datetime) * 1000;
            } else if (datetime.length == 13) {
                datetime = parseInt(datetime);
            }
        }
        datetime = new Date(datetime);
        var o = {
            "M+" : datetime.getMonth() + 1, //月份
            "d+" : datetime.getDate(), //日
            "h+" : datetime.getHours(), //小时
            "m+" : datetime.getMinutes(), //分
            "s+" : datetime.getSeconds(), //秒
            "q+" : Math.floor((datetime.getMonth() + 3) / 3), //季度
            "S" : datetime.getMilliseconds()
            //毫秒
        };
        if (/(y+)/.test(fmt))
            fmt = fmt.replace(RegExp.$1, (datetime.getFullYear() + "")
                .substr(4 - RegExp.$1.length));
        for ( var k in o)
            if (new RegExp("(" + k + ")").test(fmt))
                fmt = fmt.replace(RegExp.$1,
                    (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k])
                        .substr(("" + o[k]).length)));
        return fmt;
    }
</script>
<script type="text/html" id="hot">
    {{#  if(d.hot == 0){ }}
    不热门
    {{#  } else { }}
    热门
    {{#  } }}
</script>
</body>
</html>

 